The mkt.\-py application builder supports the std\-::cout output stream, with most of the standard operations. The standard download procedure logs on screen what is received over the serial channel, so cout can be used as debug output.

The \hyperlink{class_r_t_o_s}{R\-T\-O\-S} defines the trace macro, which can be used like cout, but prefixes each output with the current source file name and the current source line number. Hence (after the appropriate preparations) the statement


\begin{DoxyCode}
 trace << \textcolor{stringliteral}{"n="} << n << \textcolor{stringliteral}{"\(\backslash\)n"};
\end{DoxyCode}


can create the output line


\begin{DoxyCode}
 main.c:20 n=15
\end{DoxyCode}


This provides an easy way to check if and when a certain line of code is executed, and optionally print some debugging information.

Note that at the default baudrate (38k4) each character will take $\sim$ 250 us, so the above line (15 characters) would take $\sim$ 4 ms. The suggested initialization does not implement buffering, so using cout or trace can change the timing of a task that does printing considerably.

All objects (\hyperlink{class_r_t_o_s}{R\-T\-O\-S}, task, event, all waitables, mutex, pool, mailbox, channel) can be printed to an ostream using the $<$$<$ operator. Printing the \hyperlink{class_r_t_o_s}{R\-T\-O\-S} will print all \hyperlink{class_r_t_o_s}{R\-T\-O\-S} objects. 